import axios from "axios";

const wpsreq=axios.create({
    baseURL:"https://api.xyy.pub/wps",
    timeout:5000
})
wpsreq.interceptors.request.use(config=>{
    // console.log("wps config",config)
    return config
},
error=>{
    // console.log("wps resquet error",error)
    return Promise.reject(error)
}
)

wpsreq.interceptors.response.use(
    response=>{
        console.log(response)
        return response.data
        // if(response.data.code===200){
        // }else{
        //     return Promise.reject(response.data)
        // }
    },
    error=>{
        // console.log("wps response error",error)
        return Promise.reject(error)
    }
)

export default wpsreq